package com.example.test
import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity


class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        val array =
            arrayOf(
                "banana",
                "1abc",
                "薄荷",
                "apple",
                "apple1",
                "cherry",
                "date",
                "apple2",
                "土豆",
                "马铃薯"
            )
        val array1 =
            arrayOf(
                "banana",
                "1abc",
                "薄荷",
                "apple",
                "apple1",
                "cherry",
                "date",
                "apple2",
                "土豆",
                "马铃薯"
            )
        val array2 =
            arrayOf(
                "banana",
                "1abc",
                "薄荷",
                "apple",
                "apple1",
                "cherry",
                "date",
                "apple2",
                "土豆",
                "马铃薯"
            )

        val demo = SortDemo()
        findViewById<Button>(R.id.sortButton).setOnClickListener {
            demo.arraysSort(array)
            demo.quickSort(array1)
            demo.bubbleSort(array2)
        }

    }


}